import { Message } from '@arco-design/web-vue'
const TOAST_DURATION = 1500
export class ToastUtils {
  static normal(content: string) {
    Message.clear()
    Message.normal({
      duration: TOAST_DURATION,
      resetOnHover: true,
      content
    })
  }

  static info(content: string) {
    Message.clear()
    Message.info({
      duration: TOAST_DURATION,
      resetOnHover: true,
      content
    })
  }

  static success(content: string) {
    Message.clear()
    Message.success({
      duration: TOAST_DURATION,
      resetOnHover: true,
      content
    })
  }

  static warning(content: string) {
    Message.clear()
    Message.warning({
      duration: TOAST_DURATION,
      resetOnHover: true,
      content
    })
  }

  static error(content: string) {
    Message.clear()
    Message.error({
      duration: TOAST_DURATION,
      resetOnHover: true,
      content
    })
  }

  static loading(content: string) {
    Message.loading({
      duration: TOAST_DURATION,
      resetOnHover: true,
      content
    })
  }
}

export default ToastUtils
